<template>
  <el-form :inline="true" :model="formInline" class="demo-form-inline">
    <el-form-item>
      <el-input v-model="formInline.user" placeholder="请输入名字、年龄等..."></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">查询</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
    props:{
        getList:{
            type:Function
        }
    },
  data() {
    return {
      formInline: {
        user: "",
      },
    };
  },
  methods: {
    onSubmit() {
        let search = this.formInline.user;
        if(search===""){
            this.getList(1);
        }else{
            this.getList(search)
        }
        
    },
  },
};
</script>

<style>
</style>